Method and apparatus for document formatting with efficient figure element layout manipulation

ABSTRACT

A method and an apparatus for document formatting, capable of reflecting the preference of the operator and overall balance, such that the desired formatting can be obtained efficiently without tedious post-processing operations. In the apparatus, document data representing the document, including figure data representing figure elements of the document, and region data indicating layout region to which the document is to be laid out, are inputted, candidate layouts for each figure element to be laid out are generated, one of the generated candidate layouts is selected, and the document is formatted in the layout region, according to the selected one of the candidate layouts.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a method and an apparatus forformatting a document including both figure data and text data.

2. Description of the Background Art

In a document formatting apparatus, a document represented by documentdata, including text data and figure data, is formatted appropriatelyinto a specified format according to region data specifying regions atwhich the document data are to be laid out. In this formattingoperation, highly sophisticated knowledge data are necessary in order toachieve the most suitable layout, with appropriate consideration forvarious aspects such as an amount of data to be laid out, semanticrelationships among the data, and an overall balance of each page.

However, in a conventional document formatting apparatus, sufficientlysophisticated knowledge data have been missing, so that determination ofthe arrangement of the data and margins have depended largely onempirically acquired skills or the patience of an experienced operator.

Conventional document formatting system determines the arrangement ofthe data automatically by utilizing the referential relationshipsbetween the text data and the figure data, but the arrangementobtainable in such a system is inflexible, and ignores any preference ofthe operator and an overall balance.

In such a conventional document formatting apparatus, if a manualoperation type, all the arrangement of data and margins have to bespecified manually, so that the amount of operations required becomesenormous, and efficiency is very low. If it is an automatic operationtype, the preference of the operator and overall balance are completelyignored, so that tedious post-processing manual correction andmodification operations are indispensable, and, as a result, theefficiency is also very low.

SUMMARY OF THE INVENTION

It is, therefore, an object of the present invention to provide a methodand apparatus for document formatting, capable of reflecting thepreference of the operator and the overall balance, such that thedesired formatting can be obtained efficiently without tediouspost-processing operations.

According to one aspect of the present invention, there is provided anapparatus for formatting a document, comprising means for inputtingdocument data representing the document, including figure datarepresenting figure elements of the document, and region data indicatinga layout region to which the document is to be laid out; means forgenerating candidate layouts for each figure element to be laid out. Ameans for selecting one of the candidate layouts generated by thegenerating means: and means for formatting the document in the layoutregion according to the selected one of the candidate layouts.

According to another aspect of the present invention there is provided amethod of formatting a document, comprising the steps of inputtingdocument data representing the document, including figure datarepresenting figure elements of the document, and region data indicatinglayout region to which the document is to be laid out; generatingcandidate layouts for each figure element to be laid out; selecting oneof the candidate layouts generated at the generating step; andformatting the document in the layout region, according to the selectedone of the candidate layouts.

Other features and advantages of the present invention will becomeapparent from the following description taken in conjunction with theaccompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of one embodiment of a document formattingapparatus according to the present invention.

FIGS. 2(A) and 2(B) are illustrations of text data and figure data as anexample of a document to be formatted by the apparatus of FIG. 1.

FIG. 3 is an illustration of region data as an example of a document tobe formatted by the apparatus of FIG. 1.

FIG. 4 is an illustration of the text data and figure data of FIGS. 2(A)and 2(B) showing logical attributes and referencing relationshipsappearing in the document.

FIGS. 5(A) and 5(B) are illustrations of the example of the document tobe formatted, at two stages in a document formatting process performedby the apparatus of FIG. 1.

FIG. 6 is an illustration of information on the current status of layoutof the document, obtained by a layout status monitoring unit of theapparatus of FIG. 1.

FIG. 7 is a flow chart for a candidate layout position generationoperation by a layout position candidate generation unit of theapparatus of FIG. 1.

FIG. 8 is a table of rules for a layout with respect to a page frame, alayout with respect to a sentence frame, and a layout in relation toalready laid out figure element, to be used by the layout positioncandidate generation unit of the apparatus of FIG. 1.

FIGS. 9(A), 9(B), 9(C), and 9(D) are illustrations of examples ofcandidate layout positions with respect to the page frame, generated bythe layout position candidate generation unit of the apparatus of FIG.1.

FIGS. 10(A) and 10(B) are illustrations of examples of candidate layoutpositions with respect to the sentence frame, generated by the layoutposition candidate generation unit of the apparatus of FIG. 1.

FIGS. 11(A), 11(B) and 11(C) are illustrations of examples of candidatelayout positions with respect to the other figure element, generated bythe layout position candidate generation unit of the apparatus of FIG.1.

FIG. 12 is a flow chart for a candidate layout estimating operation by alayout result estimation unit of the apparatus of FIG. 1

FIGS. 13(A), 13(B), 13(C), 13(D), 13(E) and 13(F) are illustrations ofthe candidate layouts estimated by the layout result estimation unit ofthe apparatus of FIG. 1.

FIGS. 14(A) and 14(B) are illustrations of cases in which the adjustmentof margin size is necessary, and FIGS. 14(C) and 14(D) are illustrationsof the results of adjustment of margin size for the cases of FIGS. 14(A)and 14(B), respectively.

FIG. 15 is a table of evaluation items used by the layout statusevaluation unit of the apparatus of FIG. 1.

FIGS. 16(A), 16(B), 16(C), 16(D) and 16(E) are illustrations ofsituations for which an evaluation item in the table of FIG. 15regarding a reversal of an order of figure elements becomes relevant.

FIGS. 17(A) and 17(B) are illustrations of situations for which anevaluation item in the table of FIG. 15 regarding dividing of a sentenceframe by figure elements becomes relevant.

FIG. 18 is an illustration of a situation for which an evaluation itemin the table of FIG. 15 regarding a case of small remaining space in asentence frame becomes relevant.

FIG. 19 is a table summarizing a result of evaluation for the candidatelayouts of FIGS. 13(A), 13(B), 13(C), 13(D), 13(E) and 13(F), by thelayout status evaluation unit of the apparatus of FIG. 1, using theevaluation items in the table of FIG. 15.

FIG. 20 is a table of rules for determining order of preference amongthe candidate layouts used by a candidate order determination unit ofthe apparatus of FIG. 1.

FIG. 21 is an illustration of a candidate selection menu provided by anoperator selection input unit of the apparatus of FIG. 1.

FIG. 22 is an illustration of a display for a candidate layout selectionoperation, displaying a group of the candidate layouts together on asingle display.

FIG. 23 is an illustration of a display for a candidate layout selectionoperation, displaying the candidate layouts in a form of line framesover a display of already laid out document data.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Referring now to FIG. 1, one embodiment of a document formattingapparatus according to the present invention will be described indetail.

This document formatting apparatus comprises: a data input unit 1 forentering input data; a document data memory unit 2 and a region datamemory unit 3 for storing document data and region data of the inputdata, respectively; a document formatting unit 4 for formatting adocument given by the input data; a display control unit 5 and a displayunit 6 for displaying the formatted document obtained by the documentformatting unit 4; a candidate layout generation unit 7 for generatingcandidates for a layout of the document data; a candidate selectioncontrol unit 14 for facilitating a selection of a candidate for a layoutto be made by an operator on the display unit 6; and an operatorselection input unit 15 for allowing the operator to indicate hisselection of a candidate for a layout.

The candidate layout generation unit 7 further comprises: a layoutstatus monitoring unit 8, connected to the display control unit 5, formonitoring a current status of the layout of the document data; a layoutposition candidate generation unit 9 for generating candidate positionsfor a next figure element to be laid out; a layout result estimationunit 10 for estimating the layout resulting from the candidate positionsgenerated by the layout position candidate generating unit 9; a layoutstatus evaluation unit 11 for evaluating the layout estimated by thelayout result estimation unit 10; an unsatisfactory candidate layoutelimination unit 12 for eliminating unsatisfactory candidate layouts;and a candidate order determination unit 13, connected to the candidateselection control unit 14, for determining an order of preference amongthe candidate layouts.

In this configuration, the document data, including text datarepresenting sentences of the document and figure data representingdrawings and tables of the document as well as the region data includinginformation on a position and a size of a page and a frame for a layingout the document data, are entered from the data input unit 1. This unitis equipped with devices such as a keyboard, a mouse, and an imagescanner. The document data and the region data entered from the datainput unit 1 are stored in the document data memory unit 2 and theregion data memory unit 3, respectively.

In formatting the document given by the document data, the document dataand the region data stored in the document data memory unit 2 and theregion data memory unit 3 are fed to the document formatting unit 4 inwhich the document data are formatted according to the region data.

The document data formatted by the document formatting data 4 are sentto the display control unit 5 so as to have the formatted documentdisplayed on the display unit 6 for inspection by the operator.

In this process of formatting, whenever the figure data appear in thedocument data, the document formatting unit 4 activates the candidatelayout generation unit 7. This candidate layout generation unit 7generates the candidate positions for laying out the drawings and tablesgiven by the figure data among the sentences given by the text data byan analysis performed by the layout position candidate generation unit 9on the current status of the layout of the document data obtained by thelayout status monitoring unit 8.

The layout result estimation unit 10 estimates the layout resulting fromeach candidate position, and the layout status evaluation unit 11evaluates the estimated layout according to prescribed evaluation items.The candidate layout elimination unit 12 eliminates those candidatelayouts whose evaluation by the layout status evaluation unit 11 areunsatisfactory according to the prescribed evaluation items, and thecandidate order determination unit 13 determines the order of preferenceamong the remaining candidate layouts according to the evaluationobtained by the layout status evaluation unit 11.

The candidate layouts thus generated by the candidate layout generationunit 7 are sent through the candidate selection control unit 14 to thedisplay control unit 5, so as to have the generated candidate layoutsdisplayed on the display unit 6 along with the order of preferencedetermined by the candidate order determination unit 13.

The operator enters his choice of the desired layout from the displayedlist of the candidate layouts, through the operator selection input unit15. The operator's selection is communicated to the candidate selectioncontrol unit 14, from which the selected layout is fed to the documentformatting unit 4 which continues its formatting operation by using theselected layout.

Thus, in this apparatus, the layout of the drawings and tables given bythe figure data among the sentences given by the text data aredetermined according to the operator's selection of the desired layoutout of the automatically generated candidate layouts, so that it ispossible to format the document in a manner which reflects thepreference of the operator and the overall balance. Thus, the desiredformatting can be obtained efficiently without tedious post-processingoperations in this apparatus.

The operation of this apparatus will now be described in detail for acase of formatting a specific example of a document.

In the following, an example of a document to be formatted is given bythe document data comprising a text data shown in FIG. 2(A) and a figuredata shown in FIG. 2(B), and the region data shown in FIG. 3.

The text data shown in FIG. 2(A) includes logical attributes such as atitle, an author, an affiliation, a chapter heading, and a chaptersentence, which are classified to be analizable by a structural analysisor an analysis operation of the operator to identify an attribute ofeach sentence.

The figure data shown in FIG. 2(B) contains drawings and tables to beincorporated into the sentences given by the text data.

The logical attributes in the text data of FIG. 2(A) are shown in detailin FIG. 4. In addition, the referencing relationship between the textdata of FIG. 2(A) and the figure data of FIG. 2(B) indicated by an arrowin FIG. 4 is also contained in the text data and the figure data.

The region data shown in FIG. 3 contains information for each pageregarding a position and a size of a page frame #P1 as well as positionsand sizes of sentence frames #T1, #T2, and #T3 inside the page frame#P1. In addition, there is also provided data for each sentence frame inwhich logical attributes, a format and an order of arrangement forsentences to be laid out inside this sentence frame are tabulated. Thus,in the region data shown in FIG. 3, the sentence frame #T1 is assignedto the title, author, and affiliation, in this order, while the sentenceframes #T2 and #T3 are assigned to the main text given by the chapterheadings and chapter sentences. In formatting the document given by thedocument data of FIGS. 2(A) and 2(B), the document formatting unit 4lays out the sentences given by the text data according to the logicalattributes assigned to each sentence frame, in an order assigned to eachsentence frame.

Thus, when the input data including the document data of FIGS. 2(A) and2(B), and the region data of FIG. 3 are entered, the document formattingunit 4 lays out the sentences carrying the logical attributes of thetitle, author, and affiliation into the sentence frame #T1 using thespecified format, while laying out the sentences carrying the logicalattributes of the chapter heading and chapter sentence into the sentenceframes #T2 and #T3, as shown in FIG. 5(A).

When this process reaches a referencing phrase "FIG. 1" of the text dataas shown in FIG. 5(A), the candidate layout generation unit 7 isactivated in order to determine the appropriate layout for "FIG. 1" ofthe figure data, such as that shown in FIG. 5(B), as follows.

First, the layout status monitoring unit 8 obtains the current status ofthe layout determined so far, in a form of data shown in FIG. 6. Namely,the data of FIG. 6 contains information regarding a position and a sizeof each page frame, a position and a size of each sentence frame insideeach page frame, names of the immediately preceding and immediatelyfollowing sentence frames for the same logical attributes, a positionand a size of each sentence in each sentence frame, and a referencingrelationship. Also, the layout status monitoring unit 8 obtains a sizeof "FIG. 1" to be laid out, from the document formatting unit 4.

The layout position candidate generation unit 9 then generates thecandidate positions for laying "FIG. 1" out, using the informationobtained by the layout status monitoring unit 8, according to the flowchart of FIG. 7, as follows.

First, at the step 701, candidate positions for "FIG. 1" are generatedby comparing the size of "FIG. 1" and the size of the page frame,according to a set of rules for layout with respect to a page frameshown in FIG. 8. In the case of "FIG. 1", the size of this "FIG. 1" isless than a half of that of the page frame #P1 both in length and width,which matches with the condition P1, so that there are four candidatepositions of an upper left corner, an upper right corner, a lower leftcorner, and a lower right corner, as shown in FIGS. 9(A), 9(B), 9(C),and 9(D), respectively, where the candidate positions appear shaded.

Next, at the step 702, a sentence frame containing a referencing phrasefor "FIG. 1" is searched. If such a sentence frame cannot be found, theprocess goes to the step 705 to be described below. Otherwise, when sucha sentence frame is found, the step 703 is taken next.

At the step 703, the candidate positions in that sentence frame aregenerated, by comparing the size of "FIG. 1" and the size of thatsentence frame, according to a set of rules for layout with respect to asentence frame shown in FIG. 8. In this example, the referencing phraseis contained in the third sentence frame #T3, and the size of "FIG. 1"is such that the length is less than a half of that of the sentenceframe #T3 while the width is more than a half of that of the sentenceframe #T3 but not more than that of the sentence frame #T3, whichmatches with the condition T2, so that there are two candidate positionsof a top center of the sentence frame and a bottom center of thesentence frame, as shown in FIGS. 10(A) and 10(B), where the candidatepositions appear shaded again.

Next, at the step 704, whether a next sentence frame exists inside thesame page frame or not is determined. If the next sentence frame existsinside the same page frame, the process returns to the step 703 in orderto generate further candidate positions in that next sentence frame.Otherwise, the step 705 is taken next. In this example, the nextsentence frame is located on the next page frame #P2, so that the nextsentence frame does not exist inside the same page frame.

At the step 705, whether there is another figure element already laidout inside the same page frame or not is determined. If such anotherfigure element does not exist, the process terminates, whereas otherwisethe step 706 will be taken. In this example, no other figure clement islaid out in this page frame #P1, so that the process terminates afterthe step 705.

At the step 706, the candidate positions in relation to the already laidout figure element are generated, by comparing the size of a new figureelement and the size of the already laid out figure element, accordingto a set of rules for layout in relation to already laid out figureelement shown in FIG. 8. For example, in laying out "FIG. 3" to the pageframe in which "FIG. 2" has already been laid out, if the size of "FIG.3" is such that the length is less than a half of that of "FIG. 2" whilethe width is more than a half of that of "FIG. 2" but not more than thatof "FIG. 2", which matches with the condition F2, then there are threecandidate positions of an immediately below the already laid out figureelement, an upper right with respect to the already laid out figureelement, and a lower right with respect to the already laid out figureelement, as shown in FIGS. 11(A), 11(B), and 11(C), where the candidatepositions appear shaded again.

Next at the step 707, whether there is still another figure elementalready laid out inside the same page frame or not is determined. Ifsuch another figure element does not exist, the process terminates,whereas otherwise the process returns to the step 706 in order togenerate further candidate positions in relation to that still anotheralready laid out figure element inside the same page frame.

When this candidate position generation process is completed, all thecandidate positions generated in the course of this process are sent tothe layout result estimation unit 10. In a case of the example of thedocument data of FIGS. 2(A) and 2(B) and the region data of FIG. 3, sixcandidate positions shown in FIGS. 9(A), 9(B), 9(C), 9(D), 10(A), and10(B) are sent to the layout result estimation unit 10.

The layout result estimation unit 10 estimates the overall layoutresulting from each candidate position for "FIG. 1", by using thecoordinates of the layout positions and margin sizes determined from thecandidate positions and sizes of the letter font used for thesurrounding text data, according to the flow chart of FIG. 12, asfollows.

First, at the step 1201, a position of the figure element to be laid outand a margin to be formed around the figure element is determined.Namely, for those candidate positions which are specified to be on acorner, such as the candidate positions of FIGS. 9(A), 9(B), 9(C), and9(D), a frame of the figure element to be laid out is superposed on thesentence frame at an appropriate corner without a margin, such that themargin of a size based on a standard letter size is formed along edgesof the figure element which are located away from the corner, as shownin FIGS. 13(A), 13(B), 13(C), and 13(D), where the margin appearsshaded. On the other hand, for those candidate positions which arespecified to be on a top or bottom center, such as the candidatepositions of FIGS. 10(A) and 10(B), a middle line of a frame of thefigure element to be laid out is superimposed over a middle line of thesentence frame, such that the margin of a size based on a standardletter size is formed along edges of the figure element except for aspecified top or bottom edge, as shown in FIGS. 13(E) and 13(F), wherethe margin appears shaded again.

Next, at the step 1202, whether there is a region of the sentence framewhich becomes too narrow for laying out the text data as a result of themargin determined at the step 1201 is checked. Namely, the layouts atcorners such as those of FIGS. 13 (C) and 13(D) may leave a narrowstripe of a region in the sentence frame which is too narrow for layingout the text data as shown in FIGS. 14(A) and 14(B). In such a case,next at the step 1203, the size of the margin is adjusted to eliminatesuch an inappropriately narrow region in the sentence frame, as shown inFIGS. 14(C) and 14(D).

Next, at the step 1204, whether or not the laid out figure element andmargin are within the page frame is checked. When the figure element andmargin are completely within the page frame, such a layout is judged tobe a successful one and the process terminates. Otherwise, next at thestep 1205, whether the adjustment of the margin size alone is sufficientto place the entire figure element and margin within the page frame ornot is determined. In a case in which only a part of the margin islocated outside the page frame, the adjustment of the margin size issufficient, so that next at the step 1206 the margin size is adjusted toplace the entire figure element and margin within the page frame, andthe process returns to the step 1204. Otherwise, when a part of thefigure element itself is located outside the page frame, adjustment ofthe margin size alone is not sufficient, so that the such a layout isjudged to be an unsuccessful one and the process terminates.

When the estimation of the layout results is completed by the layoutresult estimation unit 10, the layout status evaluation unit 11evaluates each layout result according to the prescribed evaluationitems such as those shown in FIG. 15. Namely, according to FIG. 15, thefollowing seven items are to be checked in evaluating each layoutresult.

1. Is it placed within the page frame?

2. Is it not overlapping with the previously laid out figure element?

3. Is it not overlapping with the other sentence frames assigned todifferent logical attributes?

4. Can the referencing phrase be placed on the same page?

5. Is it not placed at a position where the order of figure elements isreversed, with respect to the previously laid out figure element?

6. Is it not dividing the sentence frame in parts?

7. In a case a remaining space of the sentence frame on that page issmall, is it placed at a bottom of that sentence frame containing thereferencing phrase?

Among these evaluation items, the fifth item regarding the reversal ofthe order of the figure elements becomes relevant in the situations suchas those shown in FIGS. 16(A) to 16(E). Namely, this evaluation item isrelevant in placing more than one figure elements on the same page, andchecks whether the figure elements appears in an order by which theirreferencing phrases occur in the text data. Here, it is sufficient thatthe figure elements appear in the correct order along the sentenceframes in a direction of reading the text data. Thus, in thisembodiment, the situations of FIGS. 16(A) and 16(C) are considered asthe layouts in which the figure elements are correctly ordered, whilethe situations of FIGS. 16(B), 16(D) and 16(E) are considered as thelayouts in which the order of the figure elements is reversed.

As for the sixth item regarding the dividing of the sentence frame, thisevaluation item checks the situations such as those shown in FIGS. 17(A)and 17(B) in which the text data region of sentence frame appears to bedivided into pieces by the figure elements.

As for the seventh item, it checks the presence of the figure element ata bottom of the sentence frame containing the referencing phrase in acase such as that shown in FIG. 18 where the remaining space of thatsentence frame on that page is small. Namely, in general, the figureelement is not likely to be placed at a bottom of the sentence frame,because this positioning prevents the layout of any other figure elementin the same sentence frame thereafter. This is particularly true whenthe remaining space of that sentence frame is large, in which case, theother referencing phrase for the other figure element may appear in theremaining space. However, in the case the remaining space of thatsentence frame is small, it is often preferable to place the figureelement at the bottom of the sentence frame from a point of view ofbalance. Now, in such a case, it is highly unlikely that the otherreferencing phrase for the other figure element may appear in theremaining space, so that only in such a case, the figure element may beplaced at the bottom of the sentence frame without causing otherproblem. The seventh item checks the occurrence of such a situation.

The result of evaluation according to these evaluation items of FIG. 15applied to the six candidate layouts of FIGS. 13(A) to 13(F), issummarized in the table shown in FIG. 19. A circle in each entryindicates that the item of that entry is satisfied by the layout of thatentry.

In FIG. 19, the first three items are considered particularly important,so they are classified as first rate evaluation items, while the otherfour items are classified as less important, second rate evaluationitems.

The unsatisfactory candidate layout elimination unit 12 then eliminatesthose candidate layouts which are considered unsatisfactory as finalcandidate layouts. In this embodiment, those candidate layouts whichfail to satisfy any one of the first rate evaluation items areconsidered unsatisfactory as final candidate layouts, and are eliminatedat this point. Thus, two candidate layouts of the page frame upper leftcorner and the page frame upper right corner, corresponding to thelayouts of FIGS. 13(A) and 13(B), are eliminated as unsatisfactory atthis point.

The candidate order determination unit 13 then determines the order ofpreference among the remaining candidate layout, according to rules forthe candidate order determination shown in FIG. 20. Namely, according toFIG. 20, those candidate layouts in which the figure element is placedin relation to the other already laid out figure elements are consideredmore preferable than those candidate layouts in which the figure elementis placed with respect to the sentence frame. Those candidate layouts inwhich the figure element is placed with respect to the sentence frameare considered preferable those candidate layouts in which the figureelement is placed with respect to the page frame. Among the candidatelayouts belonging to the same one of these three categories, the orderis determined by a number of the second rate evaluation items satisfiedby each candidate layout. Thus, for the candidate layouts of FIGS.13(C), 13(D), 13(E), and 13(F), the order of preference shown in FIG. 19can be determined by the candidate order determination unit 13.

Information such as the layout position coordinates, margin size, andorder of preference on the candidate layouts remaining at this point issent to the candidate selection control unit 14.

At the candidate selection control unit 14, the information on thelayout position coordinates and margin size of each candidate layout issequentially sent to the display control unit 5, according to the orderof preference, such that each candidate layout can be displayed on thedisplay unit 6 in an actual form of the layout result. For the candidatelayouts of FIGS. 13(A) to 13(F), the first candidate layout is that ofthe sentence frame top center according to FIG. 19, so that the layoutresult shown in FIG. 5(B) is displayed on the display unit 6 first.

The operator watching the display on the display unit 6 then makes hischoice of the layout by using the operator selection input unit 15,which provides a candidate selection menu in a form shown in FIG. 21from which the operator selects a desired menu entry in order to performthe candidate selection operation.

In the candidate selection menu of FIG. 21, a menu entry "SELECT THISLAYOUT" is to be selected by the operator when the operator is choosingthe candidate layout currently displayed on the display unit 6 as hisfinal choice. When this menu entry is selected, the information on thelayout position coordinates and margin size of this layout is sent tothe document formatting unit 4 through the candidate selection controlunit 14, so as to continue the document formatting process by using thislayout.

A menu entry "NEXT CANDIDATE" is to be selected in displaying the nextcandidate layout in the order of preference. Thus, the candidate layoutscan be displayed sequentially in a descending their order of preferenceby repeatedly selecting this menu entry. When this menu entry isselected while the candidate layout of the lowest order of preference isbeing displayed, the operator is notified of the last candidate layout,and the display of the first candidate layout is resumed on the displayunit 6.

A menu entry "PREVIOUS CANDIDATE" is selected in displaying the previouscandidate layout in the order of preference. Thus, the candidate layoutscan be displayed sequentially in an ascending order of their order ofpreference by repeatedly selecting this menu entry. When this menu entryis selected while the candidate layout of the highest order ofpreference is being displayed, the operator is notified that this is thefirst candidate layout.

A menu entry "FIRST CANDIDATE" is to be selected in displaying the firstcandidate layout in the order of preference.

A menu entry "LAYOUT POSITION CHANGE" is to be selected in manuallyspecifying the change of the layout position to a position not offeredby the candidate layouts. When this menu entry is selected, a frame ofthe figure element to be laid out appears on the display of the alreadylaid out document data such as that shown in FIG. 5(A). This frame ofthe figure element can be freely moved by the operator on the display ofthe already laid out document data by using a mouse. When the frame ofthe figure element is moved to a desired position, the candidateselection control unit 14 calculates the appropriate margin size anddisplays the layout result on the display unit 6. Here, the margin mayalso be specified by the operator. The operator may returns to thecandidate layouts by selecting the menu entry "FIRST CANDIDATE" afterselecting this menu entry "LAYOUT POSITION CHANGE".

A menu entry "CANDIDATE LIST" is to be selected in displaying all thecandidate layouts together on a single display. When this menu entry isselected, contracted images of all the candidate layouts are displayedtogether, in an arrangement according to the order of preference, asshown in FIG. 22, where the order of preference is also displayed beloweach candidate layout. When the number of candidate layouts are toonumerous for displaying all of the candidate layouts together in thismanner, the candidate layouts may be divided into groups, where eachgroup are displayed together in the manner described above, and theoperator is provided with means for selecting the groups to bedisplayed. The operator may returns to the individual candidate layoutdisplay mode by selecting an entry "INDIVIDUAL DISPLAY" on the"CANDIDATE LIST" display, as shown in FIG. 22.

A menu entry "TO BE LAID OUT ON NEXT PAGE" is to be selected when theoperator decides to place the figure element on the next page. When thismenu entry is selected, the document formatting operation is continuedto the end of the current page, and the layout of figure element isdetermined when the document formatting process proceeds to the nextpage.

A menu entry "AUTOMATIC SELECTION" is to be selected when the firstcandidate layout is to be selected in all the subsequent layouts of theremaining figure elements automatically, so as to reduce the demand onthe operator.

These menu entries of the candidate selection menu may be simplified,for example, for accommodating just the selection from the candidatelist of FIG. 22. Here, the order of preference of each candidate layoutand, preferably also a total number of the candidate layouts, aredisplayed along with each candidate layout.

Alternatively, the candidate selection control unit 14 may facilitatethe operator's candidate selection operation by displaying all thecandidate layout positions in the form of line frames over the displayof the already laid out document data, as shown in FIG. 23, where thefirst candidate layout position is indicated by a bold solid line, thesecond candidate layout position is indicated by a thin solid line, anda third candidate layout position is indicated by a dashed line, and soon. The frames may also be accompanied by numerals indicating the orderof preference of each candidate layout position.

Thus, according to this embodiment, the document formatting process canbe performed, with the preference of the operator and overall balancetaken into account, so that the desired formatting can be obtainedefficiently without tedious post-processing operations and detailedexpert knowledge on document formatting or master maneuvering by theoperator.

It is to be noted that although the above embodiment has been describedfor a case of formatting the document including both text data andfigure data, the present invention can also be applied to a case offormatting a document including just figure data or just image data.

Besides these, many modifications and variations of the aboveembodiments may be made without departing from the novel andadvantageous features of the present invention. Accordingly, all suchmodifications and variations are intended to be included within thescope of the appended claims.

What is claimed is:
 1. An apparatus for formatting a document,comprising:means for inputting document data representing the documentincluding figure data representing figure elements of the document, andregion data indicating a layout region on which the document is to belaid out; means for generating candidate layouts for each figure elementto be laid out, each candidate layout representing a different overallappearance of the layout region resulting from a different layoutposition in the layout region at which each figure element is laid out;means for selecting one of the candidate layouts generated by thegenerating means; and means for formatting the document laid out in thelayout region, realizing the different overall appearance of the layoutregion represented by the selected one of the candidate layouts.
 2. Theapparatus of claim 1, wherein the document data also includes text datarepresenting text elements of the document, and formatting means formatsthe text elements of the document consecutively according to aprescribed procedure for formatting the text elements.
 3. The apparatusof claim 1, wherein the generating means includes:means for monitoring acurrent status of a layout of the document; means for generatingcandidate layout positions for each figure element according to thecurrent status of the layout of the document; and means for estimatingthe candidate layouts resulting from placing of said each figure elementat each of the candidate layout positions.
 4. The apparatus of claim 1,wherein the generating means includes:means for evaluating the candidatelayouts according to prescribed evaluation rules; and means fordetermining an order of preference among the candidate layouts accordingto the evaluation by the evaluating means.
 5. The apparatus of claim 4,wherein the generating means further includes means for eliminatingunsatisfactory candidate layouts according to an evaluation by theevaluating means.
 6. The apparatus of claim 4, wherein the selectingmeans selects one of the candidate layouts for which the order ofpreference is highest.
 7. The apparatus of claim 1, wherein theselecting means includes:means for displaying the candidate layouts; andmeans for allowing an operator to select one of the displayed candidatelayouts.
 8. The apparatus of claim 7, wherein the generating meansincludes means for determining an order of preference among thecandidate layouts, and the display means also displays the order ofpreference along with each candidate layout.
 9. The apparatus of claim7, wherein the generating means includes means for determining an orderof preference among the candidate layouts, and the display meansdisplays the candidate layouts in the order of preference sequentially.10. The apparatus of claim 7, wherein the generating means includesmeans for determining an order of preference among the candidatelayouts, and the display means displays the candidate layouts togetherin an arrangement according to the order of preference.
 11. A method offormatting a document, comprising the steps of:inputting document datarepresenting the document including figure data representing figureelements of the document, and region data indicating a layout region onwhich the document is to be laid out; generating candidate layouts foreach figure element to be laid out, each candidate layout representing adifferent overall appearance of the layout region resulting from adifferent layout position in the layout region at which each figureelement is laid out; selecting one of the candidate layouts generated atthe generating step; and formatting the document laid out in the layoutregion, realizing the different overall appearance of the layout regionrepresented by the selected one of the candidate layouts.
 12. The methodof claim 11, wherein the document data also includes text datarepresenting text elements of the document, and at the formatting stepthe text elements of the document are formatted consecutively accordingto a prescribed procedure for formatting the text elements.
 13. Themethod of claim 11, wherein the generating step includes the stepsof:monitoring a current status of a layout of the document; generatingcandidate layout positions for said each figure element according to thecurrent status of the layout of the document; and estimating thecandidate layouts resulting from placing of said each figure element ateach of the candidate layout positions.
 14. The method of claim 11,wherein the generating step includes the steps of:evaluating thecandidate layouts according to prescribed evaluation rules; anddetermining an order of preference among the candidate layouts accordingto the evaluation at the evaluating step.
 15. The method of claim 14,wherein the generating step further includes the step of eliminatingunsatisfactory candidate layouts according to an evaluation at theevaluating step.
 16. The method of claim 14, wherein at the selectingstep, one of the candidate layouts for which the order of preference ishighest is selected.
 17. The method of claim 11, wherein the selectingstep includes the steps of:displaying the candidate layouts; andallowing an operator to select one of the displayed candidate layouts.18. The method of claim 17, wherein the generating step includes thestep of determining an order of preference among the candidate layouts,and at the displaying step the order of preference is also displayedalong with each candidate layout.
 19. The method of claim 17, whereinthe generating step includes the step of determining an order ofpreference among the candidate layouts, and at the displaying step thecandidate layouts are displayed in the order of preference sequentially.20. The method of claim 17, wherein the generating step includes thestep of determining an order of preference among the candidate layouts,and at the display step the candidate layouts are displayed together inan arrangement according to the order of preference.